package com.example.zhaojianxu.signin.car.mycar

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import com.example.zhaojianxu.signin.R
import com.example.zhaojianxu.signin.car.http.MyCarEntity

/**
 * create by @zhaojianxu on 2019/3/1
 */
class MyCarAdapter: RecyclerView.Adapter<MyCarVH>(){

    var mList = mutableListOf<MyCarEntity>()

    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): MyCarVH {
        return MyCarVH(LayoutInflater.from(parent?.context).inflate(R.layout.item_my_car_view,parent,false))
    }

    override fun getItemCount(): Int {
        return mList.size
    }

    override fun onBindViewHolder(holder: MyCarVH?, position: Int) {
        holder?.binData(mList[position])
    }

}